<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>My Project: HttpClient.h 源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">My Project
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function() { init_codefold(0); });
/* @license-end */
</script>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="headertitle"><div class="title">HttpClient.h</div></div>
</div><!--header-->
<div class="contents">
<a href="HttpClient_8h.html">浏览该文件的文档.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span> </div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno">   15</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno">   16</span> </div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno">   17</span><span class="preprocessor">#include &lt;<a class="code" href="exports_8h.html">drogon/exports.h</a>&gt;</span></div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno">   18</span><span class="preprocessor">#include &lt;<a class="code" href="HttpTypes_8h.html">drogon/HttpTypes.h</a>&gt;</span></div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno">   19</span><span class="preprocessor">#include &lt;<a class="code" href="drogon__callbacks_8h.html">drogon/drogon_callbacks.h</a>&gt;</span></div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno">   20</span><span class="preprocessor">#include &lt;<a class="code" href="HttpResponse_8h.html">drogon/HttpResponse.h</a>&gt;</span></div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno">   21</span><span class="preprocessor">#include &lt;<a class="code" href="HttpRequest_8h.html">drogon/HttpRequest.h</a>&gt;</span></div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno">   22</span><span class="preprocessor">#include &lt;trantor/utils/NonCopyable.h&gt;</span></div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno">   23</span><span class="preprocessor">#include &lt;trantor/net/EventLoop.h&gt;</span></div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno">   24</span><span class="preprocessor">#include &lt;cstddef&gt;</span></div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno">   25</span><span class="preprocessor">#include &lt;functional&gt;</span></div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno">   26</span><span class="preprocessor">#include &lt;memory&gt;</span></div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno">   27</span><span class="preprocessor">#include &lt;future&gt;</span></div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno">   28</span><span class="preprocessor">#include &quot;<a class="code" href="HttpBinder_8h.html">drogon/HttpBinder.h</a>&quot;</span></div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno">   29</span> </div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno">   30</span><span class="preprocessor">#ifdef __cpp_impl_coroutine</span></div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno">   31</span><span class="preprocessor">#include &lt;drogon/utils/coroutine.h&gt;</span></div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno">   32</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno">   33</span> </div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno">   34</span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespacedrogon.html">drogon</a></div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno">   35</span>{</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno">   36</span><span class="keyword">class </span>HttpClient;</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"><a class="line" href="namespacedrogon.html#a9ccd906e021b5648eb87decb50c2c7e7">   37</a></span><span class="keyword">using </span><a class="code hl_typedef" href="namespacedrogon.html#a9ccd906e021b5648eb87decb50c2c7e7">HttpClientPtr</a> = std::shared_ptr&lt;HttpClient&gt;;</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno">   38</span><span class="preprocessor">#ifdef __cpp_impl_coroutine</span></div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno">   39</span><span class="keyword">namespace </span>internal</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno">   40</span>{</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno">   41</span><span class="keyword">struct </span>HttpRespAwaiter : <span class="keyword">public</span> CallbackAwaiter&lt;HttpResponsePtr&gt;</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno">   42</span>{</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno">   43</span>    HttpRespAwaiter(<a class="code hl_class" href="classdrogon_1_1HttpClient.html">HttpClient</a> *client, <a class="code hl_typedef" href="namespacedrogon.html#a5200699555f98a809538342baa167aad">HttpRequestPtr</a> req, <span class="keywordtype">double</span> timeout)</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno">   44</span>        : client_(client), req_(std::move(req)), timeout_(timeout)</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno">   45</span>    {</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno">   46</span>    }</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno">   47</span> </div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno">   48</span>    <span class="keywordtype">void</span> await_suspend(std::coroutine_handle&lt;&gt; handle);</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno">   49</span> </div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno">   50</span>  <span class="keyword">private</span>:</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno">   51</span>    <a class="code hl_class" href="classdrogon_1_1HttpClient.html">HttpClient</a> *client_;</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno">   52</span>    <a class="code hl_typedef" href="namespacedrogon.html#a5200699555f98a809538342baa167aad">HttpRequestPtr</a> req_;</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno">   53</span>    <span class="keywordtype">double</span> timeout_;</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno">   54</span>};</div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno">   55</span> </div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno">   56</span>}  <span class="comment">// namespace internal</span></div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno">   57</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno">   58</span> </div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno">   60</span> </div>
<div class="foldopen" id="foldopen00072" data-start="{" data-end="};">
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"><a class="line" href="classdrogon_1_1HttpClient.html">   72</a></span><span class="keyword">class </span><a class="code hl_define" href="exports_8h.html#a00d0a001c2dd03906272e00b0598182e">DROGON_EXPORT</a> <a class="code hl_class" href="classdrogon_1_1HttpClient.html">HttpClient</a> : <span class="keyword">public</span> trantor::NonCopyable</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno">   73</span>{</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno">   74</span>  <span class="keyword">public</span>:</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"><a class="line" href="classdrogon_1_1HttpClient.html#a75a3a447835761796fd1518bbd60a552">   91</a></span>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classdrogon_1_1HttpClient.html#a75a3a447835761796fd1518bbd60a552">sendRequest</a>(<span class="keyword">const</span> <a class="code hl_typedef" href="namespacedrogon.html#a5200699555f98a809538342baa167aad">HttpRequestPtr</a> &amp;req,</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno">   92</span>                             <span class="keyword">const</span> <a class="code hl_typedef" href="namespacedrogon.html#a42bee205ed433dfbe0cc131684ae3562">HttpReqCallback</a> &amp;callback,</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno">   93</span>                             <span class="keywordtype">double</span> timeout = 0) = 0;</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno">   94</span> </div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"><a class="line" href="classdrogon_1_1HttpClient.html#a2baf533123ff6b3f5e855fb0922a4fb4">  111</a></span>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classdrogon_1_1HttpClient.html#a2baf533123ff6b3f5e855fb0922a4fb4">sendRequest</a>(<span class="keyword">const</span> <a class="code hl_typedef" href="namespacedrogon.html#a5200699555f98a809538342baa167aad">HttpRequestPtr</a> &amp;req,</div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno">  112</span>                             <a class="code hl_typedef" href="namespacedrogon.html#a42bee205ed433dfbe0cc131684ae3562">HttpReqCallback</a> &amp;&amp;callback,</div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno">  113</span>                             <span class="keywordtype">double</span> timeout = 0) = 0;</div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno">  114</span> </div>
<div class="foldopen" id="foldopen00130" data-start="{" data-end="}">
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"><a class="line" href="classdrogon_1_1HttpClient.html#a9851520c2f52037200182dd1248cce72">  130</a></span>    std::pair&lt;ReqResult, HttpResponsePtr&gt; <a class="code hl_function" href="classdrogon_1_1HttpClient.html#a9851520c2f52037200182dd1248cce72">sendRequest</a>(<span class="keyword">const</span> <a class="code hl_typedef" href="namespacedrogon.html#a5200699555f98a809538342baa167aad">HttpRequestPtr</a> &amp;req,</div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno">  131</span>                                                      <span class="keywordtype">double</span> timeout = 0)</div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno">  132</span>    {</div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno">  133</span>        assert(!getLoop()-&gt;isInLoopThread() &amp;&amp;</div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno">  134</span>               <span class="stringliteral">&quot;Deadlock detected! Calling a sync API from the same loop as &quot;</span></div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno">  135</span>               <span class="stringliteral">&quot;the HTTP client processes on will deadlock the event loop&quot;</span>);</div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno">  136</span>        std::promise&lt;std::pair&lt;ReqResult, HttpResponsePtr&gt;&gt; prom;</div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno">  137</span>        <span class="keyword">auto</span> f = prom.get_future();</div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno">  138</span>        sendRequest(</div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno">  139</span>            req,</div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno">  140</span>            [&amp;prom](<a class="code hl_enumeration" href="namespacedrogon.html#ad4f1bd941b74c9e31506ec1ec5f5cd91">ReqResult</a> r, <span class="keyword">const</span> <a class="code hl_typedef" href="namespacedrogon.html#ab2a2d829bb017f43c2c9de72f4042baa">HttpResponsePtr</a> &amp;resp) {</div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno">  141</span>                prom.set_value({r, resp});</div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno">  142</span>            },</div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno">  143</span>            timeout);</div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno">  144</span>        <span class="keywordflow">return</span> f.get();</div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno">  145</span>    }</div>
</div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno">  146</span> </div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno">  147</span><span class="preprocessor">#ifdef __cpp_impl_coroutine</span></div>
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno">  160</span>    internal::HttpRespAwaiter sendRequestCoro(<a class="code hl_typedef" href="namespacedrogon.html#a5200699555f98a809538342baa167aad">HttpRequestPtr</a> req,</div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno">  161</span>                                              <span class="keywordtype">double</span> timeout = 0)</div>
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno">  162</span>    {</div>
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno">  163</span>        <span class="keywordflow">return</span> internal::HttpRespAwaiter(<span class="keyword">this</span>, std::move(req), timeout);</div>
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno">  164</span>    }</div>
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno">  165</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno">  166</span> </div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno">  168</span> </div>
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno"><a class="line" href="classdrogon_1_1HttpClient.html#a1c46086acc82d09ef48c6df07415387c">  180</a></span>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classdrogon_1_1HttpClient.html#a1c46086acc82d09ef48c6df07415387c">setSockOptCallback</a>(std::function&lt;<span class="keywordtype">void</span>(<span class="keywordtype">int</span>)&gt; cb) = 0;</div>
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno">  181</span> </div>
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"><a class="line" href="classdrogon_1_1HttpClient.html#aed28e7469e6b46e386b705a8be5a596d">  186</a></span>    <span class="keyword">virtual</span> std::size_t <a class="code hl_function" href="classdrogon_1_1HttpClient.html#aed28e7469e6b46e386b705a8be5a596d">requestsBufferSize</a>() = 0;</div>
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno">  187</span> </div>
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno">  190</span> </div>
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"><a class="line" href="classdrogon_1_1HttpClient.html#acaf56c787b4788d70b7cedc22a8454be">  195</a></span>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classdrogon_1_1HttpClient.html#acaf56c787b4788d70b7cedc22a8454be">setPipeliningDepth</a>(<span class="keywordtype">size_t</span> depth) = 0;</div>
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno">  196</span> </div>
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno">  198</span> </div>
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"><a class="line" href="classdrogon_1_1HttpClient.html#abff0c2aee10ba12ee4273c1c70a517a2">  203</a></span>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classdrogon_1_1HttpClient.html#abff0c2aee10ba12ee4273c1c70a517a2">enableCookies</a>(<span class="keywordtype">bool</span> flag = <span class="keyword">true</span>) = 0;</div>
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno">  204</span> </div>
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno">  206</span> </div>
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno"><a class="line" href="classdrogon_1_1HttpClient.html#a659e5409827e4871c8c799e378c36b5b">  212</a></span>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classdrogon_1_1HttpClient.html#a659e5409827e4871c8c799e378c36b5b">addCookie</a>(<span class="keyword">const</span> std::string &amp;key,</div>
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno">  213</span>                           <span class="keyword">const</span> std::string &amp;value) = 0;</div>
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno">  214</span> </div>
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno">  216</span> </div>
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno"><a class="line" href="classdrogon_1_1HttpClient.html#ab56a5fdcda993f22c19afd7de69cb4b6">  222</a></span>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classdrogon_1_1HttpClient.html#ab56a5fdcda993f22c19afd7de69cb4b6">addCookie</a>(<span class="keyword">const</span> <a class="code hl_class" href="classdrogon_1_1Cookie.html">Cookie</a> &amp;cookie) = 0;</div>
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno">  223</span> </div>
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno"><a class="line" href="classdrogon_1_1HttpClient.html#a6600e618e9d2c1a14923e2b593c6ca06">  231</a></span>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classdrogon_1_1HttpClient.html#a6600e618e9d2c1a14923e2b593c6ca06">setUserAgent</a>(<span class="keyword">const</span> std::string &amp;userAgent) = 0;</div>
<div class="line"><a id="l00232" name="l00232"></a><span class="lineno">  232</span> </div>
<div class="line"><a id="l00251" name="l00251"></a><span class="lineno"><a class="line" href="classdrogon_1_1HttpClient.html#a7296d596c71819dd5397cff40f20aca0">  251</a></span>    <span class="keyword">static</span> <a class="code hl_typedef" href="namespacedrogon.html#a9ccd906e021b5648eb87decb50c2c7e7">HttpClientPtr</a> <a class="code hl_function" href="classdrogon_1_1HttpClient.html#a7296d596c71819dd5397cff40f20aca0">newHttpClient</a>(<span class="keyword">const</span> std::string &amp;ip,</div>
<div class="line"><a id="l00252" name="l00252"></a><span class="lineno">  252</span>                                       uint16_t port,</div>
<div class="line"><a id="l00253" name="l00253"></a><span class="lineno">  253</span>                                       <span class="keywordtype">bool</span> useSSL = <span class="keyword">false</span>,</div>
<div class="line"><a id="l00254" name="l00254"></a><span class="lineno">  254</span>                                       trantor::EventLoop *loop = <span class="keyword">nullptr</span>,</div>
<div class="line"><a id="l00255" name="l00255"></a><span class="lineno">  255</span>                                       <span class="keywordtype">bool</span> useOldTLS = <span class="keyword">false</span>,</div>
<div class="line"><a id="l00256" name="l00256"></a><span class="lineno">  256</span>                                       <span class="keywordtype">bool</span> validateCert = <span class="keyword">true</span>);</div>
<div class="line"><a id="l00257" name="l00257"></a><span class="lineno">  257</span> </div>
<div class="line"><a id="l00259" name="l00259"></a><span class="lineno"><a class="line" href="classdrogon_1_1HttpClient.html#a46938d38324232591ade062a91fcb106">  259</a></span>    <span class="keyword">virtual</span> trantor::EventLoop *<a class="code hl_function" href="classdrogon_1_1HttpClient.html#a46938d38324232591ade062a91fcb106">getLoop</a>() = 0;</div>
<div class="line"><a id="l00260" name="l00260"></a><span class="lineno">  260</span> </div>
<div class="line"><a id="l00262" name="l00262"></a><span class="lineno"><a class="line" href="classdrogon_1_1HttpClient.html#a86d924c406509050d2b05e43c627ba50">  262</a></span>    <span class="keyword">virtual</span> <span class="keywordtype">size_t</span> <a class="code hl_function" href="classdrogon_1_1HttpClient.html#a86d924c406509050d2b05e43c627ba50">bytesSent</a>() <span class="keyword">const</span> = 0;</div>
<div class="line"><a id="l00263" name="l00263"></a><span class="lineno"><a class="line" href="classdrogon_1_1HttpClient.html#abb7267c9991f97dc6384735dd3559db4">  263</a></span>    <span class="keyword">virtual</span> <span class="keywordtype">size_t</span> <a class="code hl_function" href="classdrogon_1_1HttpClient.html#abb7267c9991f97dc6384735dd3559db4">bytesReceived</a>() <span class="keyword">const</span> = 0;</div>
<div class="line"><a id="l00264" name="l00264"></a><span class="lineno">  264</span> </div>
<div class="line"><a id="l00265" name="l00265"></a><span class="lineno"><a class="line" href="classdrogon_1_1HttpClient.html#ae5cdd645ffe4e3778a1ef9a46d1e9f2e">  265</a></span>    <span class="keyword">virtual</span> std::string <a class="code hl_function" href="classdrogon_1_1HttpClient.html#ae5cdd645ffe4e3778a1ef9a46d1e9f2e">host</a>() <span class="keyword">const</span> = 0;</div>
<div class="line"><a id="l00266" name="l00266"></a><span class="lineno">  266</span> </div>
<div class="foldopen" id="foldopen00267" data-start="{" data-end="}">
<div class="line"><a id="l00267" name="l00267"></a><span class="lineno"><a class="line" href="classdrogon_1_1HttpClient.html#a26f0e988b577a833788aac89c0f7e7ac">  267</a></span>    std::string <a class="code hl_function" href="classdrogon_1_1HttpClient.html#a26f0e988b577a833788aac89c0f7e7ac">getHost</a>()<span class="keyword"> const</span></div>
<div class="line"><a id="l00268" name="l00268"></a><span class="lineno">  268</span><span class="keyword">    </span>{</div>
<div class="line"><a id="l00269" name="l00269"></a><span class="lineno">  269</span>        <span class="keywordflow">return</span> host();</div>
<div class="line"><a id="l00270" name="l00270"></a><span class="lineno">  270</span>    }</div>
</div>
<div class="line"><a id="l00271" name="l00271"></a><span class="lineno">  271</span> </div>
<div class="line"><a id="l00272" name="l00272"></a><span class="lineno"><a class="line" href="classdrogon_1_1HttpClient.html#ac9e0eef4b4ac55056db5d50fbb28afe3">  272</a></span>    <span class="keyword">virtual</span> uint16_t <a class="code hl_function" href="classdrogon_1_1HttpClient.html#ac9e0eef4b4ac55056db5d50fbb28afe3">port</a>() <span class="keyword">const</span> = 0;</div>
<div class="line"><a id="l00273" name="l00273"></a><span class="lineno">  273</span> </div>
<div class="foldopen" id="foldopen00274" data-start="{" data-end="}">
<div class="line"><a id="l00274" name="l00274"></a><span class="lineno"><a class="line" href="classdrogon_1_1HttpClient.html#a870c638d55f61417478cece8e72772c5">  274</a></span>    uint16_t <a class="code hl_function" href="classdrogon_1_1HttpClient.html#a870c638d55f61417478cece8e72772c5">getPort</a>()<span class="keyword"> const</span></div>
<div class="line"><a id="l00275" name="l00275"></a><span class="lineno">  275</span><span class="keyword">    </span>{</div>
<div class="line"><a id="l00276" name="l00276"></a><span class="lineno">  276</span>        <span class="keywordflow">return</span> port();</div>
<div class="line"><a id="l00277" name="l00277"></a><span class="lineno">  277</span>    }</div>
</div>
<div class="line"><a id="l00278" name="l00278"></a><span class="lineno">  278</span> </div>
<div class="line"><a id="l00279" name="l00279"></a><span class="lineno"><a class="line" href="classdrogon_1_1HttpClient.html#ad2245c812ff28a53fefb14b5bebecb37">  279</a></span>    <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="classdrogon_1_1HttpClient.html#ad2245c812ff28a53fefb14b5bebecb37">secure</a>() <span class="keyword">const</span> = 0;</div>
<div class="line"><a id="l00280" name="l00280"></a><span class="lineno">  280</span> </div>
<div class="foldopen" id="foldopen00281" data-start="{" data-end="}">
<div class="line"><a id="l00281" name="l00281"></a><span class="lineno"><a class="line" href="classdrogon_1_1HttpClient.html#a553ff50cd727f1f4cde70b60658e4a51">  281</a></span>    <span class="keywordtype">bool</span> <a class="code hl_function" href="classdrogon_1_1HttpClient.html#a553ff50cd727f1f4cde70b60658e4a51">onDefaultPort</a>()<span class="keyword"> const</span></div>
<div class="line"><a id="l00282" name="l00282"></a><span class="lineno">  282</span><span class="keyword">    </span>{</div>
<div class="line"><a id="l00283" name="l00283"></a><span class="lineno">  283</span>        <span class="keywordflow">if</span> (secure())</div>
<div class="line"><a id="l00284" name="l00284"></a><span class="lineno">  284</span>            <span class="keywordflow">return</span> port() == 443;</div>
<div class="line"><a id="l00285" name="l00285"></a><span class="lineno">  285</span>        <span class="keywordflow">return</span> port() == 80;</div>
<div class="line"><a id="l00286" name="l00286"></a><span class="lineno">  286</span>    }</div>
</div>
<div class="line"><a id="l00287" name="l00287"></a><span class="lineno">  287</span> </div>
<div class="line"><a id="l00296" name="l00296"></a><span class="lineno"><a class="line" href="classdrogon_1_1HttpClient.html#aab9337df0670830e4e2a15115fb735bd">  296</a></span>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classdrogon_1_1HttpClient.html#aab9337df0670830e4e2a15115fb735bd">setCertPath</a>(<span class="keyword">const</span> std::string &amp;cert,</div>
<div class="line"><a id="l00297" name="l00297"></a><span class="lineno">  297</span>                             <span class="keyword">const</span> std::string &amp;key) = 0;</div>
<div class="line"><a id="l00298" name="l00298"></a><span class="lineno">  298</span> </div>
<div class="line"><a id="l00309" name="l00309"></a><span class="lineno"><a class="line" href="classdrogon_1_1HttpClient.html#ae39a98a270b9ce5ca1e4b86609f33039">  309</a></span>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classdrogon_1_1HttpClient.html#ae39a98a270b9ce5ca1e4b86609f33039">addSSLConfigs</a>(</div>
<div class="line"><a id="l00310" name="l00310"></a><span class="lineno">  310</span>        <span class="keyword">const</span> std::vector&lt;std::pair&lt;std::string, std::string&gt;&gt;</div>
<div class="line"><a id="l00311" name="l00311"></a><span class="lineno">  311</span>            &amp;sslConfCmds) = 0;</div>
<div class="line"><a id="l00312" name="l00312"></a><span class="lineno">  312</span> </div>
<div class="line"><a id="l00314" name="l00314"></a><span class="lineno">  314</span> </div>
<div class="line"><a id="l00344" name="l00344"></a><span class="lineno"><a class="line" href="classdrogon_1_1HttpClient.html#a12a0463f7e09734553df1c4af137c9d1">  344</a></span>    <span class="keyword">static</span> <a class="code hl_typedef" href="namespacedrogon.html#a9ccd906e021b5648eb87decb50c2c7e7">HttpClientPtr</a> <a class="code hl_function" href="classdrogon_1_1HttpClient.html#a12a0463f7e09734553df1c4af137c9d1">newHttpClient</a>(<span class="keyword">const</span> std::string &amp;hostString,</div>
<div class="line"><a id="l00345" name="l00345"></a><span class="lineno">  345</span>                                       trantor::EventLoop *loop = <span class="keyword">nullptr</span>,</div>
<div class="line"><a id="l00346" name="l00346"></a><span class="lineno">  346</span>                                       <span class="keywordtype">bool</span> useOldTLS = <span class="keyword">false</span>,</div>
<div class="line"><a id="l00347" name="l00347"></a><span class="lineno">  347</span>                                       <span class="keywordtype">bool</span> validateCert = <span class="keyword">true</span>);</div>
<div class="line"><a id="l00348" name="l00348"></a><span class="lineno">  348</span> </div>
<div class="foldopen" id="foldopen00349" data-start="{" data-end="}">
<div class="line"><a id="l00349" name="l00349"></a><span class="lineno"><a class="line" href="classdrogon_1_1HttpClient.html#a942e907c2ccfe2f0c1e827cddef5ef72">  349</a></span>    <span class="keyword">virtual</span> <a class="code hl_function" href="classdrogon_1_1HttpClient.html#a942e907c2ccfe2f0c1e827cddef5ef72">~HttpClient</a>()</div>
<div class="line"><a id="l00350" name="l00350"></a><span class="lineno">  350</span>    {</div>
<div class="line"><a id="l00351" name="l00351"></a><span class="lineno">  351</span>    }</div>
</div>
<div class="line"><a id="l00352" name="l00352"></a><span class="lineno">  352</span> </div>
<div class="line"><a id="l00353" name="l00353"></a><span class="lineno">  353</span>  <span class="keyword">protected</span>:</div>
<div class="line"><a id="l00354" name="l00354"></a><span class="lineno"><a class="line" href="classdrogon_1_1HttpClient.html#a3ce86a8e55ff817b4b915b39c4106f25">  354</a></span>    <a class="code hl_function" href="classdrogon_1_1HttpClient.html#a3ce86a8e55ff817b4b915b39c4106f25">HttpClient</a>() = <span class="keywordflow">default</span>;</div>
<div class="line"><a id="l00355" name="l00355"></a><span class="lineno">  355</span>};</div>
</div>
<div class="line"><a id="l00356" name="l00356"></a><span class="lineno">  356</span> </div>
<div class="line"><a id="l00357" name="l00357"></a><span class="lineno">  357</span><span class="preprocessor">#ifdef __cpp_impl_coroutine</span></div>
<div class="line"><a id="l00358" name="l00358"></a><span class="lineno">  358</span> </div>
<div class="line"><a id="l00359" name="l00359"></a><span class="lineno">  359</span><span class="keyword">class </span>HttpException : <span class="keyword">public</span> std::exception</div>
<div class="line"><a id="l00360" name="l00360"></a><span class="lineno">  360</span>{</div>
<div class="line"><a id="l00361" name="l00361"></a><span class="lineno">  361</span>  <span class="keyword">public</span>:</div>
<div class="line"><a id="l00362" name="l00362"></a><span class="lineno">  362</span>    HttpException() = <span class="keyword">delete</span>;</div>
<div class="line"><a id="l00363" name="l00363"></a><span class="lineno">  363</span> </div>
<div class="line"><a id="l00364" name="l00364"></a><span class="lineno">  364</span>    <span class="keyword">explicit</span> HttpException(<a class="code hl_enumeration" href="namespacedrogon.html#ad4f1bd941b74c9e31506ec1ec5f5cd91">ReqResult</a> res)</div>
<div class="line"><a id="l00365" name="l00365"></a><span class="lineno">  365</span>        : resultCode_(res), message_(<a class="code hl_function" href="namespacedrogon.html#a704a047a6a225da2358ddaf1139f5024">to_string_view</a>(res))</div>
<div class="line"><a id="l00366" name="l00366"></a><span class="lineno">  366</span>    {</div>
<div class="line"><a id="l00367" name="l00367"></a><span class="lineno">  367</span>    }</div>
<div class="line"><a id="l00368" name="l00368"></a><span class="lineno">  368</span> </div>
<div class="line"><a id="l00369" name="l00369"></a><span class="lineno">  369</span>    <span class="keyword">const</span> <span class="keywordtype">char</span> *what() const noexcept<span class="keyword"> override</span></div>
<div class="line"><a id="l00370" name="l00370"></a><span class="lineno">  370</span><span class="keyword">    </span>{</div>
<div class="line"><a id="l00371" name="l00371"></a><span class="lineno">  371</span>        <span class="keywordflow">return</span> message_.data();</div>
<div class="line"><a id="l00372" name="l00372"></a><span class="lineno">  372</span>    }</div>
<div class="line"><a id="l00373" name="l00373"></a><span class="lineno">  373</span> </div>
<div class="line"><a id="l00374" name="l00374"></a><span class="lineno">  374</span>    <a class="code hl_enumeration" href="namespacedrogon.html#ad4f1bd941b74c9e31506ec1ec5f5cd91">ReqResult</a> code()<span class="keyword"> const</span></div>
<div class="line"><a id="l00375" name="l00375"></a><span class="lineno">  375</span><span class="keyword">    </span>{</div>
<div class="line"><a id="l00376" name="l00376"></a><span class="lineno">  376</span>        <span class="keywordflow">return</span> resultCode_;</div>
<div class="line"><a id="l00377" name="l00377"></a><span class="lineno">  377</span>    }</div>
<div class="line"><a id="l00378" name="l00378"></a><span class="lineno">  378</span> </div>
<div class="line"><a id="l00379" name="l00379"></a><span class="lineno">  379</span>  <span class="keyword">private</span>:</div>
<div class="line"><a id="l00380" name="l00380"></a><span class="lineno">  380</span>    <a class="code hl_enumeration" href="namespacedrogon.html#ad4f1bd941b74c9e31506ec1ec5f5cd91">ReqResult</a> resultCode_;</div>
<div class="line"><a id="l00381" name="l00381"></a><span class="lineno">  381</span>    std::string_view message_;</div>
<div class="line"><a id="l00382" name="l00382"></a><span class="lineno">  382</span>};</div>
<div class="line"><a id="l00383" name="l00383"></a><span class="lineno">  383</span> </div>
<div class="line"><a id="l00384" name="l00384"></a><span class="lineno">  384</span><span class="keyword">inline</span> <span class="keywordtype">void</span> internal::HttpRespAwaiter::await_suspend(</div>
<div class="line"><a id="l00385" name="l00385"></a><span class="lineno">  385</span>    std::coroutine_handle&lt;&gt; handle)</div>
<div class="line"><a id="l00386" name="l00386"></a><span class="lineno">  386</span>{</div>
<div class="line"><a id="l00387" name="l00387"></a><span class="lineno">  387</span>    assert(client_ != <span class="keyword">nullptr</span>);</div>
<div class="line"><a id="l00388" name="l00388"></a><span class="lineno">  388</span>    assert(req_ != <span class="keyword">nullptr</span>);</div>
<div class="line"><a id="l00389" name="l00389"></a><span class="lineno">  389</span>    client_-&gt;sendRequest(</div>
<div class="line"><a id="l00390" name="l00390"></a><span class="lineno">  390</span>        req_,</div>
<div class="line"><a id="l00391" name="l00391"></a><span class="lineno">  391</span>        [handle, <span class="keyword">this</span>](<a class="code hl_enumeration" href="namespacedrogon.html#ad4f1bd941b74c9e31506ec1ec5f5cd91">ReqResult</a> result, <span class="keyword">const</span> <a class="code hl_typedef" href="namespacedrogon.html#ab2a2d829bb017f43c2c9de72f4042baa">HttpResponsePtr</a> &amp;resp) {</div>
<div class="line"><a id="l00392" name="l00392"></a><span class="lineno">  392</span>            <span class="keywordflow">if</span> (result == <a class="code hl_enumvalue" href="namespacedrogon.html#ad4f1bd941b74c9e31506ec1ec5f5cd91aa60852f204ed8028c1c58808b746d115">ReqResult::Ok</a>)</div>
<div class="line"><a id="l00393" name="l00393"></a><span class="lineno">  393</span>                setValue(resp);</div>
<div class="line"><a id="l00394" name="l00394"></a><span class="lineno">  394</span>            <span class="keywordflow">else</span></div>
<div class="line"><a id="l00395" name="l00395"></a><span class="lineno">  395</span>                setException(std::make_exception_ptr(HttpException(result)));</div>
<div class="line"><a id="l00396" name="l00396"></a><span class="lineno">  396</span>            handle.resume();</div>
<div class="line"><a id="l00397" name="l00397"></a><span class="lineno">  397</span>        },</div>
<div class="line"><a id="l00398" name="l00398"></a><span class="lineno">  398</span>        timeout_);</div>
<div class="line"><a id="l00399" name="l00399"></a><span class="lineno">  399</span>}</div>
<div class="line"><a id="l00400" name="l00400"></a><span class="lineno">  400</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00401" name="l00401"></a><span class="lineno">  401</span> </div>
<div class="line"><a id="l00402" name="l00402"></a><span class="lineno">  402</span>}  <span class="comment">// namespace drogon</span></div>
<div class="ttc" id="aHttpBinder_8h_html"><div class="ttname"><a href="HttpBinder_8h.html">HttpBinder.h</a></div></div>
<div class="ttc" id="aHttpRequest_8h_html"><div class="ttname"><a href="HttpRequest_8h.html">HttpRequest.h</a></div></div>
<div class="ttc" id="aHttpResponse_8h_html"><div class="ttname"><a href="HttpResponse_8h.html">HttpResponse.h</a></div></div>
<div class="ttc" id="aHttpTypes_8h_html"><div class="ttname"><a href="HttpTypes_8h.html">HttpTypes.h</a></div></div>
<div class="ttc" id="aclassdrogon_1_1Cookie_html"><div class="ttname"><a href="classdrogon_1_1Cookie.html">drogon::Cookie</a></div><div class="ttdoc">this class represents a cookie entity.</div><div class="ttdef"><b>Definition</b> Cookie.h:32</div></div>
<div class="ttc" id="aclassdrogon_1_1HttpClient_html"><div class="ttname"><a href="classdrogon_1_1HttpClient.html">drogon::HttpClient</a></div><div class="ttdoc">Asynchronous http client</div><div class="ttdef"><b>Definition</b> HttpClient.h:73</div></div>
<div class="ttc" id="aclassdrogon_1_1HttpClient_html_a12a0463f7e09734553df1c4af137c9d1"><div class="ttname"><a href="classdrogon_1_1HttpClient.html#a12a0463f7e09734553df1c4af137c9d1">drogon::HttpClient::newHttpClient</a></div><div class="ttdeci">static HttpClientPtr newHttpClient(const std::string &amp;hostString, trantor::EventLoop *loop=nullptr, bool useOldTLS=false, bool validateCert=true)</div><div class="ttdoc">Create a Http client using the hostString to connect to server</div></div>
<div class="ttc" id="aclassdrogon_1_1HttpClient_html_a1c46086acc82d09ef48c6df07415387c"><div class="ttname"><a href="classdrogon_1_1HttpClient.html#a1c46086acc82d09ef48c6df07415387c">drogon::HttpClient::setSockOptCallback</a></div><div class="ttdeci">virtual void setSockOptCallback(std::function&lt; void(int)&gt; cb)=0</div><div class="ttdoc">Set socket options(before connecting)</div></div>
<div class="ttc" id="aclassdrogon_1_1HttpClient_html_a26f0e988b577a833788aac89c0f7e7ac"><div class="ttname"><a href="classdrogon_1_1HttpClient.html#a26f0e988b577a833788aac89c0f7e7ac">drogon::HttpClient::getHost</a></div><div class="ttdeci">std::string getHost() const</div><div class="ttdef"><b>Definition</b> HttpClient.h:267</div></div>
<div class="ttc" id="aclassdrogon_1_1HttpClient_html_a2baf533123ff6b3f5e855fb0922a4fb4"><div class="ttname"><a href="classdrogon_1_1HttpClient.html#a2baf533123ff6b3f5e855fb0922a4fb4">drogon::HttpClient::sendRequest</a></div><div class="ttdeci">virtual void sendRequest(const HttpRequestPtr &amp;req, HttpReqCallback &amp;&amp;callback, double timeout=0)=0</div><div class="ttdoc">Send a request asynchronously to the server</div></div>
<div class="ttc" id="aclassdrogon_1_1HttpClient_html_a3ce86a8e55ff817b4b915b39c4106f25"><div class="ttname"><a href="classdrogon_1_1HttpClient.html#a3ce86a8e55ff817b4b915b39c4106f25">drogon::HttpClient::HttpClient</a></div><div class="ttdeci">HttpClient()=default</div></div>
<div class="ttc" id="aclassdrogon_1_1HttpClient_html_a46938d38324232591ade062a91fcb106"><div class="ttname"><a href="classdrogon_1_1HttpClient.html#a46938d38324232591ade062a91fcb106">drogon::HttpClient::getLoop</a></div><div class="ttdeci">virtual trantor::EventLoop * getLoop()=0</div><div class="ttdoc">Get the event loop of the client;</div></div>
<div class="ttc" id="aclassdrogon_1_1HttpClient_html_a553ff50cd727f1f4cde70b60658e4a51"><div class="ttname"><a href="classdrogon_1_1HttpClient.html#a553ff50cd727f1f4cde70b60658e4a51">drogon::HttpClient::onDefaultPort</a></div><div class="ttdeci">bool onDefaultPort() const</div><div class="ttdef"><b>Definition</b> HttpClient.h:281</div></div>
<div class="ttc" id="aclassdrogon_1_1HttpClient_html_a659e5409827e4871c8c799e378c36b5b"><div class="ttname"><a href="classdrogon_1_1HttpClient.html#a659e5409827e4871c8c799e378c36b5b">drogon::HttpClient::addCookie</a></div><div class="ttdeci">virtual void addCookie(const std::string &amp;key, const std::string &amp;value)=0</div><div class="ttdoc">Add a cookie to the client</div></div>
<div class="ttc" id="aclassdrogon_1_1HttpClient_html_a6600e618e9d2c1a14923e2b593c6ca06"><div class="ttname"><a href="classdrogon_1_1HttpClient.html#a6600e618e9d2c1a14923e2b593c6ca06">drogon::HttpClient::setUserAgent</a></div><div class="ttdeci">virtual void setUserAgent(const std::string &amp;userAgent)=0</div><div class="ttdoc">Set the user_agent header, the default value is 'DrogonClient' if this method is not used.</div></div>
<div class="ttc" id="aclassdrogon_1_1HttpClient_html_a7296d596c71819dd5397cff40f20aca0"><div class="ttname"><a href="classdrogon_1_1HttpClient.html#a7296d596c71819dd5397cff40f20aca0">drogon::HttpClient::newHttpClient</a></div><div class="ttdeci">static HttpClientPtr newHttpClient(const std::string &amp;ip, uint16_t port, bool useSSL=false, trantor::EventLoop *loop=nullptr, bool useOldTLS=false, bool validateCert=true)</div><div class="ttdoc">Create a new HTTP client which use ip and port to connect to server</div></div>
<div class="ttc" id="aclassdrogon_1_1HttpClient_html_a75a3a447835761796fd1518bbd60a552"><div class="ttname"><a href="classdrogon_1_1HttpClient.html#a75a3a447835761796fd1518bbd60a552">drogon::HttpClient::sendRequest</a></div><div class="ttdeci">virtual void sendRequest(const HttpRequestPtr &amp;req, const HttpReqCallback &amp;callback, double timeout=0)=0</div><div class="ttdoc">Send a request asynchronously to the server</div></div>
<div class="ttc" id="aclassdrogon_1_1HttpClient_html_a86d924c406509050d2b05e43c627ba50"><div class="ttname"><a href="classdrogon_1_1HttpClient.html#a86d924c406509050d2b05e43c627ba50">drogon::HttpClient::bytesSent</a></div><div class="ttdeci">virtual size_t bytesSent() const =0</div><div class="ttdoc">Get the number of bytes sent or received</div></div>
<div class="ttc" id="aclassdrogon_1_1HttpClient_html_a870c638d55f61417478cece8e72772c5"><div class="ttname"><a href="classdrogon_1_1HttpClient.html#a870c638d55f61417478cece8e72772c5">drogon::HttpClient::getPort</a></div><div class="ttdeci">uint16_t getPort() const</div><div class="ttdef"><b>Definition</b> HttpClient.h:274</div></div>
<div class="ttc" id="aclassdrogon_1_1HttpClient_html_a942e907c2ccfe2f0c1e827cddef5ef72"><div class="ttname"><a href="classdrogon_1_1HttpClient.html#a942e907c2ccfe2f0c1e827cddef5ef72">drogon::HttpClient::~HttpClient</a></div><div class="ttdeci">virtual ~HttpClient()</div><div class="ttdef"><b>Definition</b> HttpClient.h:349</div></div>
<div class="ttc" id="aclassdrogon_1_1HttpClient_html_a9851520c2f52037200182dd1248cce72"><div class="ttname"><a href="classdrogon_1_1HttpClient.html#a9851520c2f52037200182dd1248cce72">drogon::HttpClient::sendRequest</a></div><div class="ttdeci">std::pair&lt; ReqResult, HttpResponsePtr &gt; sendRequest(const HttpRequestPtr &amp;req, double timeout=0)</div><div class="ttdoc">Send a request synchronously to the server and return the response.</div><div class="ttdef"><b>Definition</b> HttpClient.h:130</div></div>
<div class="ttc" id="aclassdrogon_1_1HttpClient_html_aab9337df0670830e4e2a15115fb735bd"><div class="ttname"><a href="classdrogon_1_1HttpClient.html#aab9337df0670830e4e2a15115fb735bd">drogon::HttpClient::setCertPath</a></div><div class="ttdeci">virtual void setCertPath(const std::string &amp;cert, const std::string &amp;key)=0</div><div class="ttdoc">Set the client certificate used by the HTTP connection</div></div>
<div class="ttc" id="aclassdrogon_1_1HttpClient_html_ab56a5fdcda993f22c19afd7de69cb4b6"><div class="ttname"><a href="classdrogon_1_1HttpClient.html#ab56a5fdcda993f22c19afd7de69cb4b6">drogon::HttpClient::addCookie</a></div><div class="ttdeci">virtual void addCookie(const Cookie &amp;cookie)=0</div><div class="ttdoc">Add a cookie to the client</div></div>
<div class="ttc" id="aclassdrogon_1_1HttpClient_html_abb7267c9991f97dc6384735dd3559db4"><div class="ttname"><a href="classdrogon_1_1HttpClient.html#abb7267c9991f97dc6384735dd3559db4">drogon::HttpClient::bytesReceived</a></div><div class="ttdeci">virtual size_t bytesReceived() const =0</div></div>
<div class="ttc" id="aclassdrogon_1_1HttpClient_html_abff0c2aee10ba12ee4273c1c70a517a2"><div class="ttname"><a href="classdrogon_1_1HttpClient.html#abff0c2aee10ba12ee4273c1c70a517a2">drogon::HttpClient::enableCookies</a></div><div class="ttdeci">virtual void enableCookies(bool flag=true)=0</div><div class="ttdoc">Enable cookies for the client</div></div>
<div class="ttc" id="aclassdrogon_1_1HttpClient_html_ac9e0eef4b4ac55056db5d50fbb28afe3"><div class="ttname"><a href="classdrogon_1_1HttpClient.html#ac9e0eef4b4ac55056db5d50fbb28afe3">drogon::HttpClient::port</a></div><div class="ttdeci">virtual uint16_t port() const =0</div></div>
<div class="ttc" id="aclassdrogon_1_1HttpClient_html_acaf56c787b4788d70b7cedc22a8454be"><div class="ttname"><a href="classdrogon_1_1HttpClient.html#acaf56c787b4788d70b7cedc22a8454be">drogon::HttpClient::setPipeliningDepth</a></div><div class="ttdeci">virtual void setPipeliningDepth(size_t depth)=0</div></div>
<div class="ttc" id="aclassdrogon_1_1HttpClient_html_ad2245c812ff28a53fefb14b5bebecb37"><div class="ttname"><a href="classdrogon_1_1HttpClient.html#ad2245c812ff28a53fefb14b5bebecb37">drogon::HttpClient::secure</a></div><div class="ttdeci">virtual bool secure() const =0</div></div>
<div class="ttc" id="aclassdrogon_1_1HttpClient_html_ae39a98a270b9ce5ca1e4b86609f33039"><div class="ttname"><a href="classdrogon_1_1HttpClient.html#ae39a98a270b9ce5ca1e4b86609f33039">drogon::HttpClient::addSSLConfigs</a></div><div class="ttdeci">virtual void addSSLConfigs(const std::vector&lt; std::pair&lt; std::string, std::string &gt; &gt; &amp;sslConfCmds)=0</div><div class="ttdoc">Supplies command style options for SSL_CONF_cmd</div></div>
<div class="ttc" id="aclassdrogon_1_1HttpClient_html_ae5cdd645ffe4e3778a1ef9a46d1e9f2e"><div class="ttname"><a href="classdrogon_1_1HttpClient.html#ae5cdd645ffe4e3778a1ef9a46d1e9f2e">drogon::HttpClient::host</a></div><div class="ttdeci">virtual std::string host() const =0</div></div>
<div class="ttc" id="aclassdrogon_1_1HttpClient_html_aed28e7469e6b46e386b705a8be5a596d"><div class="ttname"><a href="classdrogon_1_1HttpClient.html#aed28e7469e6b46e386b705a8be5a596d">drogon::HttpClient::requestsBufferSize</a></div><div class="ttdeci">virtual std::size_t requestsBufferSize()=0</div><div class="ttdoc">Return the number of unsent http requests in the current http client cache buffer</div></div>
<div class="ttc" id="adrogon__callbacks_8h_html"><div class="ttname"><a href="drogon__callbacks_8h.html">drogon_callbacks.h</a></div></div>
<div class="ttc" id="aexports_8h_html"><div class="ttname"><a href="exports_8h.html">exports.h</a></div></div>
<div class="ttc" id="aexports_8h_html_a00d0a001c2dd03906272e00b0598182e"><div class="ttname"><a href="exports_8h.html#a00d0a001c2dd03906272e00b0598182e">DROGON_EXPORT</a></div><div class="ttdeci">#define DROGON_EXPORT</div><div class="ttdef"><b>Definition</b> exports.h:15</div></div>
<div class="ttc" id="anamespacedrogon_html"><div class="ttname"><a href="namespacedrogon.html">drogon</a></div><div class="ttdoc">Drogon Test is a minimal effort test framework developed because the major C++ test frameworks doesn'...</div><div class="ttdef"><b>Definition</b> Attribute.h:23</div></div>
<div class="ttc" id="anamespacedrogon_html_a42bee205ed433dfbe0cc131684ae3562"><div class="ttname"><a href="namespacedrogon.html#a42bee205ed433dfbe0cc131684ae3562">drogon::HttpReqCallback</a></div><div class="ttdeci">std::function&lt; void(ReqResult, const HttpResponsePtr &amp;)&gt; HttpReqCallback</div><div class="ttdef"><b>Definition</b> drogon_callbacks.h:33</div></div>
<div class="ttc" id="anamespacedrogon_html_a5200699555f98a809538342baa167aad"><div class="ttname"><a href="namespacedrogon.html#a5200699555f98a809538342baa167aad">drogon::HttpRequestPtr</a></div><div class="ttdeci">std::shared_ptr&lt; HttpRequest &gt; HttpRequestPtr</div><div class="ttdef"><b>Definition</b> drogon_callbacks.h:26</div></div>
<div class="ttc" id="anamespacedrogon_html_a704a047a6a225da2358ddaf1139f5024"><div class="ttname"><a href="namespacedrogon.html#a704a047a6a225da2358ddaf1139f5024">drogon::to_string_view</a></div><div class="ttdeci">std::string_view to_string_view(drogon::ReqResult result)</div><div class="ttdef"><b>Definition</b> HttpTypes.h:223</div></div>
<div class="ttc" id="anamespacedrogon_html_a9ccd906e021b5648eb87decb50c2c7e7"><div class="ttname"><a href="namespacedrogon.html#a9ccd906e021b5648eb87decb50c2c7e7">drogon::HttpClientPtr</a></div><div class="ttdeci">std::shared_ptr&lt; HttpClient &gt; HttpClientPtr</div><div class="ttdef"><b>Definition</b> HttpClient.h:37</div></div>
<div class="ttc" id="anamespacedrogon_html_ab2a2d829bb017f43c2c9de72f4042baa"><div class="ttname"><a href="namespacedrogon.html#ab2a2d829bb017f43c2c9de72f4042baa">drogon::HttpResponsePtr</a></div><div class="ttdeci">std::shared_ptr&lt; HttpResponse &gt; HttpResponsePtr</div><div class="ttdef"><b>Definition</b> drogon_callbacks.h:24</div></div>
<div class="ttc" id="anamespacedrogon_html_ad4f1bd941b74c9e31506ec1ec5f5cd91"><div class="ttname"><a href="namespacedrogon.html#ad4f1bd941b74c9e31506ec1ec5f5cd91">drogon::ReqResult</a></div><div class="ttdeci">ReqResult</div><div class="ttdef"><b>Definition</b> HttpTypes.h:202</div></div>
<div class="ttc" id="anamespacedrogon_html_ad4f1bd941b74c9e31506ec1ec5f5cd91aa60852f204ed8028c1c58808b746d115"><div class="ttname"><a href="namespacedrogon.html#ad4f1bd941b74c9e31506ec1ec5f5cd91aa60852f204ed8028c1c58808b746d115">drogon::ReqResult::Ok</a></div><div class="ttdeci">@ Ok</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8
</small></address>
</body>
</html>
